#include "cCamera2D.h"

cCamera2D::cCamera2D() 
{
	m_eyePosition		= D3DXVECTOR3(0.0f, 0.0f, 0.0f);
	m_targetPosition	= D3DXVECTOR3(0.0f, 0.0f, 0.0f);
	m_upVector			= D3DXVECTOR3(0.0f, 0.0f, 0.0f);
}

cCamera2D::cCamera2D(D3DXVECTOR3 eyePosition, D3DXVECTOR3 targetPosition, D3DXVECTOR3 upVector) 
{
	m_eyePosition		= eyePosition;
	m_targetPosition	= targetPosition;
	m_upVector			= upVector;
}

cCamera2D::~cCamera2D() 
{
}

void cCamera2D::BuildCameraView() 
{
	D3DXMatrixLookAtLH(&m_view, &m_eyePosition, &m_targetPosition, &m_upVector);
}

void cCamera2D::BuildCameraProjection() 
{
	RECT R;
	GetClientRect(0, &R);
	float width = R.right;
	float height = R.bottom;
	D3DXMatrixPerspectiveFovLH( &m_projection, D3DX_PI * 0.25f, width/height,
								1.0f, 5000.0f );
}